#!/usr/bin/env python

from dict.drugs_dict import drugs as my_dict
# from dict.cell_dict import cells as my_dict
# from dict.bacteria_dict import bacterias as my_dict
# from dict.enzime_dict import enzime as my_dict
# from dict.fungi_dict import fungis as my_dict
# from dict.scince_dict import scince as my_dict
# from dict.virus_dict import virus as my_dict
# from  dict.desease_dict import deseases as my_dict
# from  dict.human_part_dict import humans_part as my_dict
# from dict.measure_dict import measures as my_dict
# from dict.operation_dict import operations as my_dict
from wiki_bda_link_detector import WikiBdaDetector
from selenium import webdriver

import time
__author__ = 'gogo'

__version__ = '0.0.1'

driver = webdriver.Firefox()


wb = WikiBdaDetector()

for q in my_dict:
    print q, wb.detect_object(q)
    wb.detect_object(q)[0],wb.detect_object(q)[1]
    if wb.detect_object(q)[1] is not None:
       driver.get("http://en.wikipedia.org/wiki/"+wb.detect_object(q)[1])
    # if wb.detect_object(c)[1] is None:
        # driver.get("http://en.wikipedia.org/wiki/" + c.capitalize())
        # assert driver.find_elements_by_xpath('//b[contains(text(), "Wikipedia does not have an article with this exact name.")]')
        # time.sleep(2)
# time.sleep(10)
driver.close()